<template>
  <div class="drugType">
    <div class="title">
      <div class="tilfon">Category Navigation</div>
    </div>
    <ul class="typelist">
      <li class="contentcard"
          :class="istype==index?'active':''"
          @mouseover="istype = index"
          @mouseout="istype = null"
          v-for="(item, index) in typelist"
          :key="index">
        <nuxt-link target="_blank"
                   :to="'/' + item.path + '/' + drug.id + '/1.html'">
          <div class="typename">{{ drug.nameEn + item.name }}</div>
        </nuxt-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["drug"],
  data () {
    return {
      istype: null,
      typelist: [
        {
          name: ' Information',
          path: 'information'
        }, //资讯
        {
          name: ' Indications',
          path: 'indications'
        },//适应症
        {
          name: ' Therapeutic Effect',
          path: 'therapeuticEffect'
        },//治疗效果
        {
          name: ' Dosage',
          path: 'dosage'
        },//用法用量
        {
          name: ' Precautions',
          path: 'precautions'
        },//注意事项
        {
          name: 'Side Effects',
          path: 'adverseReactions'
        },//副作用
      ],

    }
  },
  methods: {
    // removeNestedParentheses (str) {
    //   let prev;
    //   do {
    //     prev = str;
    //     str = str.replace(/[（）]|\([^)]*\)/g, '');
    //   } while (prev !== str);
    //   return str;
    // },
  }
}
</script>

<style lang="scss" scoped>
.drugType {
  background-color: #ffffff;
  width: 824px;
  margin-top: 16px;
  box-sizing: border-box;

  .title {
    border-bottom: 1px solid #dfe2e7;
    display: flex;
    justify-content: flex-start;

    .tilfon {
      font-weight: bold;
      font-size: 18px;
      color: #0041a3;
      line-height: 60px;
      border-bottom: 4px solid #0041a3;
    }
  }

  .typelist {
    .active {
      background: #0078ff !important;
      .typename {
        color: #fff !important;
      }
    }
    .contentcard {
      margin-top: 16px;
      height: 82px;
      background: #eef6ff;
      box-sizing: border-box;
      display: flex;
      padding: 0 16px;
      align-items: center;

      /* 垂直居中 */
      .typename {
        //width: 294px;
        font-family: Arial, Arial;
        font-weight: bold;
        font-size: 18px;
        color: #0041a3;
        text-align: left;
        font-style: normal;
        text-transform: none;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
        white-space: normal;
        -webkit-line-clamp: 1;
      }

      .content {
        display: flex;
        justify-content: flex-start;
        margin-bottom: 8px;

        .left {
          font-weight: 400;
          font-size: 14px;
          color: #5a6478;
          line-height: 18px;
          flex-shrink: 0;
        }

        .right {
          margin-left: 4px;
          font-weight: 400;
          font-size: 14px;
          color: #293347;
          line-height: 18px;
        }
      }
    }
  }
}
</style>